package com.yl.chainStore.services.sick

import com.baomidou.mybatisplus.extension.plugins.pagination.Page
import com.yl.chainStore.entity.pay.PayCustomerOrder
import com.yl.chainStore.entity.sick.CustomerSubscribeLog
import com.yl.chainStore.entity.sick.SickMedicalHistory
import com.yl.chainStore.entity.sick.SickMedicalRecords
import com.yl.chainStore.entity.sick.SickMedicalRecordsDetail
import com.yl.chainStore.entity.user.CompanyUserOperationLog
import com.yl.chainStore.pojo.vo.sick.SickMedicalHistorySelectVo
import com.yl.chainStore.pojo.vo.sick.SickMedicalRecordsDetailSelectVo
import com.yl.chainStore.pojo.vo.sick.SickMedicalRecordsDetailToStatusVo
import com.yl.chainStore.pojo.vo.sick.SickMedicalRecordsDetailUpdateVo
import com.yl.common.control.ResponseBody

/**
 * 就诊记录
 */
interface ISickMedicalRecordsService {

	/**
	 * 获取自身信息
	 */
	fun getRecord(recordId: Long): SickMedicalRecords?

	/**
	 * 保存一个明细
	 */
	fun saveDetail(detail: SickMedicalRecordsDetail): ResponseBody

	/**
	 * 通过就诊明细生成一个预约
	 */
	fun createSubscribeLogByDetail(detail: SickMedicalRecordsDetail):ResponseBody

	/**
	 * 获取就诊记录关联的订单
	 */
	fun getOrder(recordId: Long): List<PayCustomerOrder>

	/**
	 * 就诊进行中
	 */
	fun setRecordToOngoing(recordId: Long): ResponseBody

	/**
	 * 就诊暂停 （下次客户还会来）
	 */
	fun setRecordToPause(recordId: Long): ResponseBody

	/**
	 * 就诊结束
	 */
	fun setRecordToEnd(recordId: Long): ResponseBody

	/**
	 * 获取病历分页
	 */
	fun getHistoryPage(page: Page<SickMedicalHistory>, vo: SickMedicalHistorySelectVo): Page<SickMedicalHistory>


	//就诊明细相关

	/**
	 * 获取明细详情
	 */
	fun getDetailByDetailId(id: Long): SickMedicalRecordsDetail?

	/**
	 * 通过就诊记录明细预约内容
	 */
	fun updateDetailByDetailId(vo: SickMedicalRecordsDetailUpdateVo):ResponseBody

	/**
	 * 通过预约修改就诊记录
	 */
	fun updateDetailBySubscribeLog(subscribeLog: CustomerSubscribeLog):ResponseBody

	/**
	 * 修改就诊记录明细全部字段
	 */
	fun updateDetailAllField(detail:SickMedicalRecordsDetail):ResponseBody

	/**
	 * 用户到了，预约 ==> 未到
	 */
	fun customerCanCome(detailId: Long): ResponseBody

	fun customerCanCome(detail: SickMedicalRecordsDetail): ResponseBody

	/**
	 * 用户到了，（预约的直接挂号）未到 ==>  等待中
	 */
	fun customerCome(detailId: Long): ResponseBody

	fun customerCome(detail: SickMedicalRecordsDetail): ResponseBody

	/**
	 * 用户就诊
	 */
	fun customerVisiting(detailId: Long): ResponseBody

	fun customerVisiting(detail: SickMedicalRecordsDetail): ResponseBody

	/**
	 * 用户就诊结束
	 */
	fun customerVisitingEnd(detailId: Long): ResponseBody

	fun customerVisitingEnd(detail: SickMedicalRecordsDetail): ResponseBody

	/**
	 * 用户订单付款完成
	 */
	fun customerOrderPayEnd(detailId: Long): ResponseBody

	fun customerOrderPayEnd(detail: SickMedicalRecordsDetail): ResponseBody

	/**
	 * 就诊结束(离店)
	 */
	fun detailOver(detailId: Long): ResponseBody

	fun detailOver(detail: SickMedicalRecordsDetail): ResponseBody

	/**
	 * 就诊明细 至 某状态  按照顺序过去的
	 */
	fun detailToStatus(vo: SickMedicalRecordsDetailToStatusVo): ResponseBody

	/**
	 * 书写病历完成
	 */
	fun detailSetHistoryId(detailId:Long,historyId: Long):ResponseBody

	/**
	 * 就诊记录明细 状态回退，其他不处理
	 */
	fun backDetailStatus(id:Long):ResponseBody

	/**
	 * 取消就诊记录
	 * 1,就诊记录改成预约
	 * 2， -1 如果没有预约，则添加一条今天的预约
	 *     -2 如果有预约，则将预约改成未处理状态
	 */
	fun cancelRecordDetail(id: Long):ResponseBody

	/**
	 * 取消就诊记录 改成取消状态
	 */
	fun onlyCancelRecordDetail(id: Long):ResponseBody

	/**
	 * 删除就诊记录 (预约也删除)
	 */
	fun delDetail(id:Long):ResponseBody

	/**
	 * 删除就诊记录(预约也删除)
	 */
	fun delDetail(detail: SickMedicalRecordsDetail):ResponseBody

	/**
	 * 获取修改记录
	 */
	fun getRecordDetailUpdateLog(id:Long):List<CompanyUserOperationLog>

}
